--  "Elerta"

function autoexec()
 if (get_progress(P_CARAVEL) == 2) then
  set_ent_chrx(HERO1, 0);
    if (get_numchrs() == 2) then
          set_ent_chrx(HERO2, 0)
    end
  set_progress(P_CARAVEL,3)
end

      
end

function refresh()
  return
end

function postexec()
end

function zone_handler(zn)
  if (zn == 1) then
    change_map("land","vil_exit");

  elseif (zn == 2) then
    touch_fire(get_pidx(0));

  elseif (zn == 3) then
    door_in(66,22,62,14,70,24);

  elseif (zn == 4) then
    door_in(66,8,62,0,70,10);

  elseif (zn == 5) then
    door_in(81,8,77,0,85,10);

  elseif (zn == 6) then
    door_in(54,22,50,14,58,24);

  elseif (zn == 7) then
    door_in(54,8,50,0,58,9);

  elseif (zn == 8) then
    thought(HERO1,"The door is locked")

  elseif (zn == 9) then
    door_out(7,27)

  elseif (zn == 10) then
    door_out(32,28)

  elseif (zn == 11) then
    door_out(35,12)

  elseif (zn == 12) then
    door_out(16,5)

  elseif (zn == 13) then
    door_out(3,12)

  elseif (zn == 14) then
    chest(1,I_MESRA,1);
    set_obs(36,27,0);
 --   set_progress(MESRA, 1);

  elseif  (zn == 15) then
    inn("Dew Drop Inn",20,3);

  elseif (zn == 16) then
    thought(HERO1,"You stop and smell the flowers.")



  end
end

function entity_handler(en)
  if (en == 0) then


  elseif  (en == 1) then


  elseif  (en == 2) then


  elseif  (en == 3) then

    if (prompt(en,2,0,"Would you like to take a ride back to Grimbsy for a mere 200 gold?","  yes","  no","") == 0) then 
      if (get_gp() < 200) then
        bubble(en,"Ya trying to cheat me. Thats not enough gold.");
      elseif (get_gp() >= 200) then
        set_gp(get_gp() - 200)
        msg("You pay Captain Finch 200 gold.")
        bubble(en,"Alright let's set sail.");
        set_ent_chrx(HERO1, 34)
        if (get_numchrs() == 2) then
          set_ent_chrx(HERO2, 98)
        end
        change_map("land","vilcar_exit");
        set_progress(P_CARAVEL,4);  
      end 
    else
      bubble(en,"Well come back by another time.");
   end
    
end
       end 
